﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Web.ASPxGridView;

namespace UdrinkWater_Project.Admin
{
    public partial class Referent_Unpaid : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["Order_Date"] = Session["Referent"].ToString();
        }
        protected void detailGrid_DataSelect(object sender, EventArgs e)
        {
            Session["Order_Date"] = (sender as ASPxGridView).GetMasterRowKeyValue();
        }

        protected void GV_OrderList_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
        {
            if (e.Column.FieldName == "Total")
            {
                double Count = Convert.ToDouble(e.GetListSourceFieldValue("Product_Count"));
                double Price = Convert.ToDouble(e.GetListSourceFieldValue("Price"));
                double Distcount = Convert.ToDouble(e.GetListSourceFieldValue("Discount"));
                e.Value = (Count * Price) - Distcount;
            }
        }

        protected void bt_Cancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("UnpaidList.aspx");
        }
    }
}